/**
 * 
 */
package ch.unizh.ifi.ailab.config;

import java.util.Properties;

import ch.unizh.ifi.ailab.utils.Utils;

/**
 * @author hans
 * 
 */
public abstract class RobosuitcaseProperties extends Properties {

	/**
	 * encoding setting for all property classes.
	 */
	protected static final String ENCODING = "UTF-8";
	
	abstract public void configDefaults();

	/**
	 * returns the property value as an int value.
	 * 
	 * @param key =
	 *            property name
	 * @return the value to the corresponding key as int.
	 */
	public int getIntProperty(String key) {
		String value = getProperty(key);
		if (value == null) {
			return 0;
		}
		return Integer.parseInt(value);

	}

	/**
	 * returns the property value as a double value.
	 * 
	 * @param key =
	 *            property name
	 * @return the value to the corresponding key as double.
	 */
	public double getDoubleProperty(String key) {
		String value = getProperty(key);
		if (value == null) {
			return 0;
		}
		return Double.parseDouble(value);

	}

}
